package com.zy.ivideo.controller;


import com.zy.ivideo.entity.ResponseEntity;
import com.zy.ivideo.entity.VideoTypeEntity;
import com.zy.ivideo.service.VideoTypeService;
import com.zy.ivideo.token.PassToken;
import com.zy.ivideo.token.UserToken;
import com.zy.ivideo.utils.ResponseUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.persistence.Query;
import java.util.List;

@RestController
@RequestMapping("/videotype")
@Api(value = "视频类型模块API接口", description = "该模块提供视频类型模块服务", tags = "视频类型模块")
public class VideoTypeController {
    @Autowired
    VideoTypeService service;
    /**
     * 获取Simple视频类型信息
     * @return
     */
    @PassToken
    @ApiOperation(value = "获取Simple视频类型信息", notes = "获取Simple视频类型信息", httpMethod = "GET")
    @GetMapping("/getSimpleType")
    public ResponseEntity<List<VideoTypeEntity>> getSimpleType(){
        return service.getSimpleType();
    }

    /**
     * 获取Mutil视频类型信息
     * @return
     */
    @PassToken
    @ApiOperation(value = "获取MutilType视频类型信息", notes = "获取MutilType视频类型信息", httpMethod = "GET")
    @GetMapping("/getMutilType")
    public ResponseEntity<List<VideoTypeEntity>> getMutilType(){
       return service.getMutilType();
    }

    /**
     * 根据上级id获取Mutil视频类型信息
     * @return
     */
    @PassToken
    @ApiOperation(value = "根据上级id获取Mutil视频类型信息", notes = "根据上级id获取Mutil视频类型信息", httpMethod = "GET")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(dataType = "int", name = "pid", value = "上级id", required = true),
    })
    @GetMapping("/getMutilTypeByPid")
    public ResponseEntity<List<VideoTypeEntity>> getMutilTypeByPid(int pid){
        return service.getMutilTypeByPid(pid);
    }
}
